package example.documentbased.mainModule
{
	import example.documentbased.mainModule.controller.CommonController;
	import example.documentbased.mainModule.controller.ICommonController;
	import example.documentbased.mainModule.controller.IMainController;
	import example.documentbased.mainModule.controller.MainController;
	import example.documentbased.mainModule.controller.RefreshAllCommand;
	import example.documentbased.mainModule.controller.StartupCommand;
	import example.documentbased.mainModule.mediations.EditorsFacade;
	import example.documentbased.mainModule.mediators.MainModuleViewMediator;
	import example.documentbased.mainModule.models.MainModel;
	import example.documentbased.mainModule.models.factories.ItemsFactory;
	import example.documentbased.mainModule.models.mappers.DocumentMapper;
	import example.documentbased.mainModule.models.mappers.EditorMapper;
	import example.documentbased.mainModule.services.IDocumentService;
	import example.documentbased.mainModule.services.IEditorService;
	import example.documentbased.mainModule.services.IServiceLocator;
	import example.documentbased.mainModule.services.ServiceLocator;
	import example.documentbased.mainModule.services.delegates.IMainServiceDelegate;
	import example.documentbased.mainModule.services.delegates.MainServiceDelegate;
	import example.documentbased.mainModule.services.mocks.DocumentServiceMock;
	import example.documentbased.mainModule.services.mocks.EditorServiceMock;
	import example.documentbased.mainModule.services.mocks.ServiceMockModel;
	import example.documentbased.mainModule.views.MainModuleView;
	
	import flash.display.DisplayObject;
	
	import org.etherframework.controller.common.ShowPopUpCommand;
	import org.etherframework.core.Module;
	
	public class MainModule extends Module
	{
		public function MainModule(view:DisplayObject)
		{
			super(view);
		}
		
		override public function start():void
		{
			dependencies.addClass(StartupCommand);
			dependencies.addClass(ShowPopUpCommand);
			dependencies.addClass(RefreshAllCommand);
			
			dependencies.addSingleton(EditorsFacade);
			dependencies.addSingleton(ServiceLocator, IServiceLocator);
			dependencies.addClass(CommonController, ICommonController);
			
			dependencies.addClass(MainController, IMainController);
			dependencies.addClass(MainServiceDelegate, IMainServiceDelegate);
			dependencies.addClass(EditorServiceMock, IEditorService);
			dependencies.addClass(DocumentServiceMock, IDocumentService);
			dependencies.addSingleton(ItemsFactory);
			
			dependencies.addSingleton(EditorMapper);
			dependencies.addSingleton(DocumentMapper);
			dependencies.addSingleton(ServiceMockModel);
			dependencies.addSingleton(MainModel);
			
			mediators.addMediator(MainModuleView, MainModuleViewMediator);
		}
	}
}